<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="../commons/list.jsp"%>

<html>
<head>
  <meta charset="UTF-8">
 <!--  <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
  <link rel="shortcut icon" href="<%=basePath%>common/img/car.ico" type="image/x-icon"/>
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Login</title>
</head>
<script type="text/javascript">
$(function(){
	$('#div_first').backstretch([
	               "${basePath}common/img/3.jpeg",
	               "${basePath}common/img/1.jpeg",
	               "${basePath}common/img/2.jpeg"
	             ], {
	                 fade: 750,
	                 duration: 4000
	             });
})
</script>
<body>
  <div class="kit-login">
    <div class="kit-login-bg" id='div_first'></div>
    <div class="kit-login-wapper" >
      <h2 class="kit-login-slogan">欢迎使用 <br> 汽车机器人后台</h2>
      <div class="kit-login-form">
        <h4 class="kit-login-title">登录</h4>
        <form class="layui-form">
          <div class="kit-login-row">
            <div class="kit-login-col">
              <i class="layui-icon">&#xe612;</i>
              <span class="kit-login-input">
                <input type="text" name="loginName" id='loginName' lay-verify="required" placeholder="用户名/邮箱/手机号" />
              </span>
            </div>
            <div class="kit-login-col"></div>
          </div>
          <div class="kit-login-row">
            <div class="kit-login-col">
              <i class="layui-icon">&#xe64c;</i>
              <span class="kit-login-input">
                <input type="password" name="password" id='password' lay-verify="required" placeholder="密码" />
              </span>
            </div>
            <div class="kit-login-col"></div>
          </div>
          <div class="kit-login-row">
            <div class="kit-login-col">
              <input type="checkbox" name="rememberMe" title="记住帐号" lay-skin="primary">
            </div>
          </div>
          <div class="kit-login-row">
            <button class="layui-btn kit-login-btn" lay-submit="submit" lay-filter="login_hash">登录</button>
          </div>
          <div class="kit-login-row" style="margin-bottom:0;">
            <a href="javascript:;" style="color: rgb(153, 153, 153); text-decoration: none; font-size: 13px;" id="forgot">忘记密码</a>
          </div>
        </form>
      </div>
    </div>
  </div>

  
  <script>
    layui.use(['layer', 'form'], function() {
      var form = layui.form,
        $ = layui.jquery;

      $('#forgot').on('click', function() {
        layer.msg('请联系管理员.');
      });
      //监听提交
      form.on('submit(login_hash)', function(data) {
		$.post("<%=basePath%>controller/login/toLogin",data.field,function(data){
			if(data=='1'){
        		window.location.href='<%=basePath%>controller/login/main';
        	}
        	if(data=='0'){
        		layer.msg('用户名或密码错误', {time:1000}); 
        	}
		});
		return false;
      });
    });
  </script>
</body>

</html>